package de.tempel.pong.objects;

import java.awt.geom.Point2D;

import de.tempel.pong.objects.basic.AbstractGameObject;
import de.tempel.pong.objects.basic.Vector;

/**
 * Spielball
 * 
 * @author mathias
 * 
 */
public class Ball extends AbstractGameObject {

	/**
	 * 
	 * @param position
	 * @param size
	 * @param movement
	 */
	public Ball(Point2D position, double size, Vector movement) {
		super(position, size, movement);
	}

	/**
	 * 
	 * @param ball
	 */
	public Ball(Ball ball) {
		this(new Point2D.Double(ball.getPosition().getX(), ball.getPosition()
				.getY()), ball.getWidth(), new Vector(ball.getMovement()));
	}

	public void changeYMovementDirection() {
		Vector currenctMovement = this.getMovement();
		currenctMovement.setY(currenctMovement.getY() * -1);
	}

	public void changeXMovementDirection() {
		Vector currenctMovement = this.getMovement();
		currenctMovement.setX(currenctMovement.getX() * -1);
	}

}
